﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiDisplayStyle : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiDisplayStyle(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiDisplayStyle_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiDisplayStyle obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiDisplayStyle()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiDisplayStyle(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiDisplayStyle cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiDisplayStyle_cast(OdRxObject.getCPtr(pObj));
			OdGiDisplayStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiDisplayStyle_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiDisplayStyle_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiDisplayStyle_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiDisplayStyle createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiDisplayStyle_createObject();
			OdGiDisplayStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void set(OdGiDisplayStyle style)
		{
			GlobalsPINVOKE.OdGiDisplayStyle_set(this.swigCPtr, OdGiDisplayStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiDisplayStyle Assign(OdGiDisplayStyle style)
		{
			OdGiDisplayStyle result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiDisplayStyle_Assign(this.swigCPtr, OdGiDisplayStyle.getCPtr(style)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGiDisplayStyle style)
		{
			bool result = GlobalsPINVOKE.OdGiDisplayStyle_IsEqual(this.swigCPtr, OdGiDisplayStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setDisplaySettings(uint nSettings)
		{
			GlobalsPINVOKE.OdGiDisplayStyle_setDisplaySettings(this.swigCPtr, nSettings);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setDisplaySettingsFlag(OdGiDisplayStyle.DisplaySettings flag, bool bEnable)
		{
			GlobalsPINVOKE.OdGiDisplayStyle_setDisplaySettingsFlag(this.swigCPtr, (int)flag, bEnable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual uint displaySettings()
		{
			uint result = GlobalsPINVOKE.OdGiDisplayStyle_displaySettings(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isDisplaySettingsFlagSet(OdGiDisplayStyle.DisplaySettings flag)
		{
			bool result = GlobalsPINVOKE.OdGiDisplayStyle_isDisplaySettingsFlagSet(this.swigCPtr, (int)flag);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setBrightness(double value)
		{
			GlobalsPINVOKE.OdGiDisplayStyle_setBrightness(this.swigCPtr, value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double brightness()
		{
			double result = GlobalsPINVOKE.OdGiDisplayStyle_brightness(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setShadowType(OdGiDisplayStyle.ShadowType type)
		{
			GlobalsPINVOKE.OdGiDisplayStyle_setShadowType(this.swigCPtr, (int)type);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiDisplayStyle.ShadowType shadowType()
		{
			OdGiDisplayStyle.ShadowType result = (OdGiDisplayStyle.ShadowType)GlobalsPINVOKE.OdGiDisplayStyle_shadowType(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		[Flags]
		public enum DisplaySettings
		{
			kNone = 0,
			kBackgrounds = 1,
			kLights = 2,
			kMaterials = 4,
			kTextures = 8
		}

		public enum ShadowType
		{
			kShadowsNone,
			kShadowsGroundPlane,
			kShadowsFull,
			kShadowsFullAndGround
		}
	}
}
